package com.hyper_yang._03_designpatterns.principles.demo3.before;

/**
 * projectName: com.hyper_yang._03_designpatterns.principles.demo3.before
 *
 * @author: sakiko
 * time: 2025/9/26 20:08
 * description: 计算机
 * 该计算机硬件仿佛不能自己改装？比如 cpu只能用 intel --> 不友好
 */
public class Computer {

    private XiJieHardDisk hardDisk;

    private IntelCpu cpu;

    private KingstonMemory memory;

    public XiJieHardDisk getHardDisk() {
        return hardDisk;
    }

    public void setHardDisk(XiJieHardDisk hardDisk) {
        this.hardDisk = hardDisk;
    }

    public IntelCpu getCpu() {
        return cpu;
    }

    public void setCpu(IntelCpu cpu) {
        this.cpu = cpu;
    }

    public KingstonMemory getMemory() {
        return memory;
    }

    public void setMemory(KingstonMemory memory) {
        this.memory = memory;
    }

    public void run() {
        System.out.println("Computer.run");
        System.out.println("hardDisk.get() = " + hardDisk.get());
        cpu.run();
        memory.save();
    }
}
